import request from "@/util/request";

/**
 * 获取壁纸分类
 */
export function getBiZhiClassification() {
  return request({
    url: "/index.php",
    method: "get",
    params: { c: "WallPaper", a: "getAllCategoriesV2", from: "360chrome" },
  });
}

/**
 * 根据壁纸分类ID获取分类下壁纸图片
 * @param {int} cid  【刚才获取到的分类ID】
 * @param {int} start 【从第几幅图开始(用于分页)】
 * @param {int} count 【每次加载的数量】
 */
export function getPictureByBiZhiClassification(
  cid = 0,
  start = 0,
  count = 10
) {
  return request({
    url: "/index.php",
    method: "get",
    params: {
      c: "WallPaper",
      a: "getAppsByCategory",
      from: "360chrome",
      cid,
      start,
      count,
    },
  });
}

/**
 * 获取最近更新的壁纸
 * @param {int} start 【从第几幅图开始(用于分页)】
 * @param {int} count 【每次加载的数量】
 */
export function getTheLatestBiZhi(start = 0, count = 10) {
  return request({
    url: "/index.php",
    method: "get",
    params: {
      c: "WallPaper",
      a: "getAppsByOrder",
      order: "create_time",
      from: "360chrome",
      start,
      count,
    },
  });
}
